import { Http } from "@/utils/request";
import { Toast } from "@/utils/toast";
import { delayTask } from "@/utils/timer";

const baseUrl = "/tour_info";

export const items_api = (showError = true) => {
  return Http.get<MiniApp.PagingData>(`/v1${baseUrl}/items`).catch(
    (error: Error) => {
      showError && delayTask(60, () => Toast.show(error.message));
      return Promise.reject(error);
    }
  );
};
